/**
 * ProjectName demo
 * FileName DemoController.java
 * PackageName com.example.demo
 * Date 2017年6月22日 下午4:44:48
 * Copyright (c) 2015, lyg945@163.com All Rights Reserved.
 */
package com.example.demo;

import java.io.IOException;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;

import com.example.entity.FileInfo;
import com.example.hadoop.HDFS;

@Controller
public class DemoController {
	
	@Autowired
	private HDFS hdfs;

	@GetMapping("/")
	public String index(ModelMap map) throws InterruptedException{
		try {
			List<FileInfo> list = hdfs.dirFile("/");
			map.put("list", list);
		} catch (IOException e) {
			e.printStackTrace();
		}
		return "index";
	}
	
	@GetMapping("/pdf")
	public String pdf(ModelMap map) throws InterruptedException{
		return "pdf";
	}
	
}
